<template>
  <div class="order">
    <div class="header2 colorWhite">
      <div>
        <router-link to="/orderOne">
          <a-icon type="left"
                  class="icon colorWhite" />
          <a class="h3 colorWhite">个人订单</a>
        </router-link>
      </div>
    </div>
    <div class="listScroll">
      <cards :mainList="mainList"></cards>
    </div>
  </div>
</template>

<script>
import cards from './cards'
import urls from '../../../common.js'
export default {
  name: 'header2',
  data () {
    return {
      mainList: [],
      bed_no: this.$store.state.bedNo
    }
  },
  components: {
    cards
  },
  created () {
    this.getPersonOrderList()
  },
  methods: {
    getPersonOrderList () {
      console.log(this.bed_no)
      var that = this
      that.$http.get(urls.getPersonOrderList + '/' + that.bed_no).then(result => { // 获取个人订单
        console.log(result.body.data)
        if (result.body.code === '200') {
          that.mainList = result.body.data
        }
      })
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '../../../../static/css/color.styl'
.order
  position relative
  background-color $color-bgc
  height 100%
  width 100%
.colorWhite
  color $color-white
.header2
  height 0.98rem
  background-color $color-main
  text-align justify
  line-height 0.98rem
  padding-left 0.3rem
  position fixed
  left 0
  top 0
  right 0
  .icon
    font-size 0.36rem
    vertical-align -0.06rem
  .h3
    display inline-block
    font-size 0.36rem
.anticon
  font-size 0.26rem
  vertical-align -0.23em
.listScroll
  position absolute
  top 0.98rem
  right 0
  bottom 0
  left 0
  overflow auto
</style>
